package com.example.demo.repository.dao.relation;

import com.example.demo.entity.relation.ConsultRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
public interface ConsultRecordDao extends JpaRepository<ConsultRecord, String>, JpaSpecificationExecutor<ConsultRecord> {
    List<ConsultRecord> findAllByUserId(String numbers);

    /**
     * 通过consultantId获取咨询师相关的记录
     * @param consultantId
     * @return List<ConsultRecord>
     */
    List<ConsultRecord> findAllByConsultantId(String consultantId);

    List<ConsultRecord> findAllByUserIdAndConsultantId(String userId, String consultantId);
}
